package communication.common.business.base;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 远程sock地址
 * @author mac
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class FcrSocketAddress {
    private String host;
    private int port;

    public String getAddress(){
        return host+":"+port;
    }

    public static FcrSocketAddress getByString(String address){
        String[] split = address.split(":");
        return new FcrSocketAddress(split[0],Integer.parseInt(split[1]));
    }

}
